checkbutton: Fix actionable state tracking
authorMatthias Clasen <mclasen@redhat.com>
Thu, 10 Jun 2021 12:37:13 +0000 (08:37 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 10 Jun 2021 12:38:12 +0000 (08:38 -0400)
If we have a GAction as model, we just have to
call gtk_action_helper_activate() and let
the action helper handle the state updates,

Fixes: #4022
gtk/gtkcheckbutton.c

index 0ed5bf8dd359e9dcb04ce1a8f9c2274bf355be9a..b5c2eecab22eb62d0d87e9cd5b4bf435d5e1189e 100644 (file)
@@ -325,10 +325,10 @@ click_released_cb (GtkGestureClick *gesture,
 
   gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
 
-  gtk_check_button_set_active (self, !priv->active);
-
   if (priv->action_helper)
     gtk_action_helper_activate (priv->action_helper);
+  else
+    gtk_check_button_set_active (self, !priv->active);
 }
 
 static void